package com.example.demo;

import java.util.ArrayList;
import java.util.List;

public class TestSubList {

    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for(int i =1;i<=5;i++){
            list.add(i);
        }
        System.out.println(list.subList(0,5));
    }
}
